import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Layout from '@/layout'

Vue.use(VueRouter)

const routes = [
{
	path: '/easybuy/news',
	component: Layout,
	children: [{name: 'news', path:'', component: () => import('@/views/easybuy/news/index.vue')}]
},
{
	path: '/easybuy/order',
	component: Layout,
	children: [{name: 'order', path:'', component: () => import('@/views/easybuy/order/index.vue')}]
},
{
	path: '/easybuy/orderDetail',
	component: Layout,
	children: [{name: 'orderDetail', path:'', component: () => import('@/views/easybuy/orderDetail/index.vue')}]
},
{
	path: '/easybuy/product',
	component: Layout,
	children: [{name: 'product', path:'', component: () => import('@/views/easybuy/product/index.vue')}]
},
{
	path: '/easybuy/productCategory',
	component: Layout,
	children: [{name: 'productCategory', path:'', component: () => import('@/views/easybuy/productCategory/index.vue')}]
},
{
	path: '/easybuy/user',
	component: Layout,
	children: [{name: 'user', path:'', component: () => import('@/views/easybuy/user/index.vue')}]
},
{
	path: '/easybuy/userAddress',
	component: Layout,
	children: [{name: 'userAddress', path:'', component: () => import('@/views/easybuy/userAddress/index.vue')}]
},
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/404',
    name: 'notfound',
    component: () => import(/* webpackChunkName: "about" */ '../views/error/404.vue')
  },
  {
    path: '/',
    name: 'Home',
    redirect: '/home',
    component: Layout,
    children: [{path: '/home', component: Home}]
  }
]

const router = new VueRouter({
  routes
})

export default router
